<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<!DOCTYPE HTML>
<html>
<head>
	<%@ include file="common/meta.jsp" %>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>芸泰医院互联网接接入管理平台</title>
	<link rel="shortcut icon" href="${ctx}/img/icon.ico">
	<link href="${ctx}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
	<link href="${ctx}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
	<link href="${ctx}/css/animate.min.css" rel="stylesheet">
	<link href="${ctx}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="${ctx}/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<link href="${ctx}/css/login.min.css" rel="stylesheet">
	<style type="text/css">
	.top-navigation .navbar-brand{background: #09275A;font-family: '微软雅黑';font-weight: bolder;}
	.top-navigation .nav>li a:focus, .top-navigation .nav>li a:hover{color: black;}
	</style>
	 <script  type="text/javascript"> 
		if (window != top){
				top.location.href = "${contextPath}/index/sessionOut";
		} 
	</script>
</head>
<body class="gray-bg top-navigation">

	<div id="wrapper">
		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom white-bg">
				<nav class="navbar navbar-static-top" role="navigation">
					<div class="navbar-header">
						<button aria-controls="navbar" aria-expanded="false"
							data-target="#navbar" data-toggle="collapse"
							class="navbar-toggle collapsed" type="button">
							<i class="fa fa-reorder"></i>
						</button>
						<a href="${contextPath}" class="navbar-brand">医疗互联网外联对接平台</a>
					</div>
					<div class="navbar-collapse collapse" id="navbar">
						<ul class="nav navbar-top-links navbar-right">
							<security:authorize access="isAuthenticated()">
							<li class="dropdown hidden-xs">
								<a data-toggle="dropdown" class="nav-top-text">
									欢迎您，<i class="fa fa-user-md"></i>
									<security:authentication property="principal.username"/>
									<b class="caret"></b>
								</a>
								<ul class="dropdown-menu animated fadeInDown m-t-xs">
									<li>
										<a class="J_menuItem" href="${contextPath}/system/user/tochangepassword">
											修改密码
										</a>
									</li>
									<li>
										<a class="J_menuItem" href="${contextPath}/system/user/userinfo">
											个人信息
										</a>
									</li>
									<li class="divider"></li>
									<li class="safe-logout">
										<a href="#">安全退出</a>
									</li>
	                            </ul>
							</li>
							<li class="safe-logout">
								<a href="#">
									<i class="fa fa-sign-out"></i>安全退出
								</a>
							</li>
							</security:authorize>
						</ul>
					</div>
				</nav>
			</div>
			<div class="wrapper wrapper-content">
				<div class="container">
					<div class="signin">
					<div class="row signinpanel">
			            <div class="col-sm-7">
			                <div class="signin-info">
			                    <div class="logopanel m-b">
			                        <h1>医疗互联网外联对接平台</h1>
			                    </div>
			                    <div class="m-b"></div>
			                    <h4>欢迎访问 <strong>医疗互联网外联对接平台</strong></h4>
			                    <ul class="m-b">
			                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 统一医疗接口对外开放平台</li>
			                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 统一医院资源前置接入平台</li>
			                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 医院基础数据管理与配置中心</li>
			                    </ul>
			                </div>
			            </div>
			            <div class="col-sm-5">
			            	<security:authorize access="isAuthenticated()">
			            	<form action="#">
			            		<h4 class="no-margins">医疗互联网外联对接平台！</h4>
			            		<p class="m-t-md">您当前正在使用的医疗互联网外联对接平台账号是：</p>
			            		<security:authentication property="principal.username"/>
			            		<a class="btn btn-success btn-block" href="${contextPath}/system/gateway/index"  target="_blank">进入管理平台</a>
			            	</form>
			            	</security:authorize>
			            	<security:authorize access="!isAuthenticated()">
							<form method="post" action="${contextPath}/openplatformlogin">
								<h4 class="no-margins">登录：</h4>
								<p class="m-t-md">登录到医疗互联网外联对接平台</p>
								<input type="text" name="username" value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}" class="form-control uname" placeholder="用户名/手机号/邮箱" />
								<input type="hidden" name="password" id="encryptPassword" style="color: black;"/>
								<input type="password" id="clearPassword" class="form-control pword m-b" placeholder="密码" />
								<p style="color: red;">${errorMsg}</p>
								<button class="btn btn-success btn-block" type="submit">登录</button>
							</form>
							</security:authorize>
			            </div>
			        </div></div>
				</div>
			</div>
			<div class="footer" >
				<div class="pull-right" style="position:absolute;right:300px">
					友情链接：
					<a href="http://www.hsyuntai.com/" target="_blank">芸泰网络</a>
					<a href="http://www.hundsun.com/" target="_blank">恒生电子</a>
				</div>
				<div style="position:absolute;left:300px">
					<strong>版权所有</strong> 杭州恒生芸泰网络科技有限公司 &copy; 2017
				</div>
			</div>
		</div>
	</div>

	<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="${ctx}/js/jquery.jcryption.3.1.0.js"></script>
	<script src="${ctx}/js/plugins/flot/jquery.flot.js"></script>
	<script src="${ctx}/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
	<script src="${ctx}/js/plugins/flot/jquery.flot.resize.js"></script>
	<script src="${ctx}/js/plugins/chartJs/Chart.min.js"></script>
	<script src="${ctx}/js/plugins/peity/jquery.peity.min.js"></script>
	<script src="${ctx}/js/plugins/sweetalert/sweetalert.min.js"></script>
	<script src="${ctx}/js/demo/peity-demo.min.js"></script>
	<script>
	</script>
	<script type="text/javascript">
	(function($){
		$(function(){
			$.jCryption.crypt.setPublicKey('${publicKey}');
			// 用户登录前密码加密
			$('#clearPassword').keyup(function(){
				valueOfEncryptPassword($(this).val());
			}).change(function(){
				valueOfEncryptPassword($(this).val());
			});
			function valueOfEncryptPassword(value){
				var encryptPassword = $.jCryption.crypt.encrypt(value);
				$('#encryptPassword').val(encryptPassword);
			}
			
			// 退出登录
			$('.safe-logout').click(function () {
				swal({
					title: "您确定要退出登录吗？",
					text: "退出登录后将需要重新登录，请谨慎操作！",
					type: "warning",
					showCancelButton: true,
					confirmButtonColor: "#DD6B55",
					cancelButtonText: "取消",
					confirmButtonText: "退出登录",
					closeOnConfirm: false
				}, function () {
					window.location.href='${contextPath}/openplatformlogout';
				});
			});
			
			
		});
	})(jQuery);
	</script>
</body>
</html>
